import type { RouteRecordRaw } from "vue-router";
export const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    redirect: "/index",
    children: [
      {
        //Training 练习室 Start
        path: "training",
        name: "Training",
        component: () => import("@/views/Training/index.vue"),
      }, //Training 练习室 End
      {
        //My_member 练习室 Start
        path: "my_member",
        name: "My_member",
        component: () => import("@/views/My_member/index.vue"),
      }, //My_member 练习室 End
    ],
  },
  {
    //index 资源模块 Start
    path: "/index/:targetId?",
    name: "Index",
    component: () => import("@/views/Index/index.vue"),
    redirect: "/index/recommend",
    children: [
      {
        path: "recommend",
        name: "Recommend",
        component: () => import("@/views/Index/components/Recommend/index.vue"),
      },
      {
        path: "original",
        name: "Original",
        component: () => import("@/views/Index/components/Original/index.vue"),
      },
      {
        path: "course",
        name: "Course",
        component: () => import("@/views/Index/components/Course/index.vue"),
      },
      {
        path: "specialTopic",
        name: "SpecialTopic",
        component: () =>
          import("@/views/Index/components/SpecialTopic/index.vue"),
      },
      {
        path: "information",
        name: "Information",
        component: () =>
          import("@/views/Index/components/Information/index.vue"),
      },
      {
        path: "attention",
        name: "Attention",
        component: () => import("@/views/Index/components/Attention/index.vue"),
      },
    ],
  }, //index 资源模块 End
  {
    //discovery 课程模块 Start
    path: "/discovery",
    name: "Discovery",
    component: () => import("@/views/Discovery/index.vue"),
    redirect: "/discovery/vip_zone",
    children: [
      {
        path: "vip_zone",
        name: "Vip_zone",
        component: () =>
          import("@/views/Discovery/components/Vip_zone/index.vue"),
      },
      {
        path: "video_courses",
        name: "Video_courses",
        component: () =>
          import("@/views/Discovery/components/Video_courses/index.vue"),
      },
      {
        path: "live_courses",
        name: "Live_courses ",
        component: () =>
          import("@/views/Discovery/components/Live_courses/index.vue"),
      },
      {
        path: "major_courses",
        name: "Major_courses",
        component: () =>
          import("@/views/Discovery/components/Major_courses/index.vue"),
      },
      {
        path: "zone_list",
        name: "Zone_list",
        component: () =>
          import("@/views/Discovery/components/Zone_list/index.vue"),
      },
    ],
  }, //discovery 课程模块 End
  {
    //center 模块 Start
    path: "/center",
    name: "Center",
    component: () => import("@/views/Center/index.vue"),
    children: [
      {
        path: "deposit",
        name: "Deposit",
        component: () => {
          import("@/views/Center/components/Deposit/index.vue")
        }
      },
      {
        path: "mediaCache",
        name: "MediaCache",
        component: () =>
          import("@/views/Center/components/MediaCache/index.vue"),
      },
      {
        path: "collections",
        name: "Collections",
        component: () =>
          import("@/views/Center/components/Collections/index.vue"),
      },
      {
        path: "view_records",
        name: "View_records",
        component: () =>
          import("@/views/Center/components/View_records/index.vue"),
      },
      {
        path: "dynamics",
        name: "Dynamics",
        component: () => import("@/views/Center/components/Dynamics/index.vue"),
      },
      {
        path: "edit_info",
        name: "Edit_info",
        component: () =>
          import("@/views/Center/components/Edit_info/index.vue"),
      },
      {
        path: "wallet",
        name: "Wallet",
        component: () =>
          import("@/views/Center/components/Wallet/index.vue"),
      },
      {
        path: "coupons",
        name: "Coupons",
        component: () =>
          import("@/views/Center/components/Coupons/index.vue"),
      },
      {
        path: "buyer",
        name: "Buyer",
        redirect: "@/views/Center/components/buyer/components/My_order/index.vue",
        component: () =>
          import("@/views/Center/components/Buyer/index.vue"),
        children: [
          {
            path: "my_order",
            name: "My_order",
            component: () => {
              import("@/views/Center/components/Buyer/components/My_order/index.vue")
            }
          }
        ]
      },
    ],
  }, //center 模块 End
  {
    //communication 交流模块 Start
    path: "/communication",
    name: "Communication",
    component: () => import("@/views/Communication/index.vue"),
    redirect: "/communication/systemNote",
    children: [
      {
        path: "systemNote",
        name: "SystemNote",
        meta: {
          title: '系统'
        },
        component: () =>
        // 系统
          import("@/views/Communication/components/SystemNote/index.vue"),
      },
      {
        path: "interactNote",
        name: "InteractNote",
        meta: {
          title: '互动'
        },
        component: () =>
        //互动
          import("@/views/Communication/components/InteractNote/index.vue"),
      },
      {
        path: "orderNote",
        name: "OrderNote",
        meta: {
          title: '订单'
        },
        component: () =>
        // 订单
          import("@/views/Communication/components/OrderNote/index.vue"),
      },
    ],
  }, //communication 交流模块 End
  {
    //home 页面 start
    path: "/home",
    name: "Home",
    
    component: () => import("@/views/Home/index.vue"),
  }, //home 页面 End
  {
    path: "/404",
    name: "404",
    component: () => import("@/views/Error/index.vue"),
  },
  /* 定义任意路由 匹配任意的路由 必须最后注册 */
  {
    path: "/:pathMatch(.*)",
    name: "Any",
    redirect: "/404",
  },
];
